package com.siyu.tickets.entity.base;

import java.io.Serializable;

import com.siyu.tickets.entity.Element;

public abstract class BaseElement implements Serializable {

	private static final long serialVersionUID = 2492231822782924230L;

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String name;
	private java.lang.String enname;

	private java.lang.String type;

	private java.lang.Integer order;
	private java.lang.Boolean enable;
	private java.util.Date createTime;

	public int getHashCode() {
		return hashCode;
	}

	public void setHashCode(int hashCode) {
		this.hashCode = hashCode;
	}

	public java.lang.Integer getId() {
		return id;
	}

	public void setId(java.lang.Integer id) {
		this.id = id;
	}

	public java.lang.String getName() {
		return name;
	}

	public void setName(java.lang.String name) {
		this.name = name;
	}

	public java.lang.String getEnname() {
		return enname;
	}

	public void setEnname(java.lang.String enname) {
		this.enname = enname;
	}

	public java.lang.String getType() {
		return type;
	}

	public void setType(java.lang.String type) {
		this.type = type;
	}

	public java.lang.Integer getOrder() {
		return order;
	}

	public void setOrder(java.lang.Integer order) {
		this.order = order;
	}

	public java.lang.Boolean getEnable() {
		return enable;
	}

	public void setEnable(java.lang.Boolean enable) {
		this.enable = enable;
	}

	public java.util.Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(java.util.Date createTime) {
		this.createTime = createTime;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Element))
			return false;
		else {
			Element user = (Element) obj;
			if (null == this.getId() || null == user.getId())
				return false;
			else
				return (this.getId().equals(user.getId()));
		}
	}

	public int hashCode() {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId())
				return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

}
